package easy.id_501_600;

public class Lee551 {
    public static void main(String[] args) {
        String s = "PPALLP";
        String s1 = "LLL";
        System.out.println(checkRecord(s1));
    }
    public static boolean checkRecord(String s) {
        int countA=0;
        int countL=0;
        int flag=0;
        for(int i=0;i<s.length();i++){
            char c=s.charAt(i);
            if(c=='A'){
                countA++;
            }else if(c=='L'){

                if(i-1>=0 && s.charAt(i-1)=='L'){
                    flag++;
                }else{
                    flag=1;
                }
            }else{
                flag=0;
            }
            if(flag==3 || countA==2){
                return false;
            }
        }
        return true;
    }

}
